<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="ZH-CN">
<c:choose>
  <c:when test="${student_name }==null">
    <c:redirect url="/LWGL"></c:redirect>
  </c:when>
</c:choose>
<head>
<title>月进展情况记录</title>
<meta http-equiv="X-UA-Compatible" content="IE=9" >
<meta name="keywords" content="吉珠,吉林大学,吉林大学珠海学院,吉林大学珠海学院论文管理">
<meta name="content-type" content="text/html" charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="${pageContext.request.contextPath}/pages1/css/bootstrap.css" type="text/css">
<script src="${pageContext.request.contextPath}/pages1/js/jquery-2.1.1.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/pages1/js/bootstrap.js" type="text/javascript"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/jquery-easyui-1.4.1/jquery.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/jquery-easyui-1.4.1/jquery.easyui.min.js"></script>
<link rel="stylesheet" href="<%=request.getContextPath()%>/jquery-easyui-1.4.1/themes/gray/easyui.css" type="text/css"></link>
<link rel="stylesheet" href="<%=request.getContextPath()%>/jquery-easyui-1.4.1/themes/icon.css" type="text/css"></link>
<script type="text/javascript" src="<%=request.getContextPath()%>/jquery-easyui-1.4.1/locale/easyui-lang-zh_CN.js"></script>
<style>
.col-xs-3 {
	padding: 1px;
	height: 1035px;
}
.col-xs-9 {
	height: 1035px;
}
.container {
	width: 1280px;
}
.xs11 {
	margin-top: 10px;
	margin-left: 30px;
}
#right {
	position: absolute;
	right: 0px;
	width: 300px;
}
#xs12 {
	height: 929px;
	width: 313px;
}
#X {
	position: absolute;
	right: 35px;
	width: 35px;
	top: 2px;
}
#xs1 {
	height: 100px;
	width: 80px;
}
body {
	font-size: 12px;
}
.actived {
	height: 25px;
	border-top: 3px solid #ff9900;
	;
	border-right: 1px solid #AAC7E9;
	border-left: 1px solid #AAC7E9;
	border-bottom: 1px solid #AAC7E9;
	background: #FFDAB9;
}
.panel-group {
	padding: 1px;
margin：1px;
}
nav {
	text-align: center;
}
span:empty {
}
</style>
<script type="text/javascript" language="javascript">
function g(o){return document.getElementById(o);}
function hoverli(n){
for(var i=1;i<=19;i++){
{g('tb_'+i).className='';}
g('tb_'+n).className='actived';}
}

function show(id){
var traget=document.getElementById(id);
traget.style.display="block";
}

function hide(id){
var traget=document.getElementById(id);
traget.style.display="none"; 
}

$(function() {
	var weektable = $('#weektable').datagrid({
				url : '<%=request.getContextPath()%>/thesisprogressrecord/table',
				pagination : true,
				pageSize : 5,
				pageList : [ 5, 10, 20 ],
				singleSelect : true,
				fitColumns : true,
				rownumbers : true,
				columns : [ [
						{
							title : '论文进展情况标题',
							field : 'title',
							width : 100,
							align : 'center',
							formatter : function(value, row, index) {
								var a = row.student_no+"_"
										+ row.student_name+"_"
										+ row.prorec_submittime;
								return a;
							}
						},
						{
							title : '指导教师',
							field : 'teacher_name',
							width : 30,
							align : 'center',
						},
						{
							title : '信息编辑操作',
							field : 'conbutton',
							width : 40,
							align : 'center',
							formatter : function(value, row, index) {
									var a ="<a data-toggle='collapse' data-parent='#accordion' href='#collapseBTG'>";
									var b="<button type='button' class='btn btn-info btn-bg' onclick='showContent("+row.prorec_id+")'>查看</button>";
									var c = "<a data-toggle='collapse' data-parent='#accordion' href='#collapseLWJZ'>";
									var d = "<button type='button' class='btn btn-warning btn-bg' onclick='editContent(edit,"
											+ row.prorec_id
											+ ")'>修改</button>";
									var e="</a>";

								return a+b+e+c+d+e;
							}
						},] ],
				});
});

function showContent(id) {
	var traget = document.getElementById("JSSH");
	traget.style.display = "block";
	$.ajax({
		url : '<%=request.getContextPath()%>/thesisprogressrecord/edit',
		Type : 'POST',
		data : {
			"id" : id
		},
		success : function showValue(r) {
			document.getElementById("teaGui").value = r.text;
		}
	});
}

function editContent(ope, id) {
	console.info(ope);
	console.info(id);
	if (ope == edit) {
		$.ajax({
			url : '<%=request.getContextPath()%>/thesisprogressrecord/edit',
			Type : 'POST',
			data : {
				"id" : id
			},
			success : function showValue(r) {
				document.getElementById("showEdit").value = r.text;
				document.getElementById("id").value = r.id;
			}
		});
	} else {
		document.getElementById("showEdit").value = null;
		document.getElementById("id").value = null;
		//  	showDiv(ope);
	}
	show('LWJZ');
}
function input_check() {
	/*	var value=document.getElementById("showEdit").value;
	 var lenght=value.replace(/[^\x00-\xff]/g, '__').length/2;
	 console.info(value);
	 console.info(lenght);
	 if(lenght>=100&&lenght<=300)
	 {*/
	 var value=document.getElementById("showEdit").value;
	 var lenght=value.replace(/[^\x00-\xff]/g, '__').length/2;
	 console.info(value);
	 console.info(lenght);
	 if(lenght<=0)
	 {
	 	$.messager.alert('提示', '请输入进展记录内容！');
	 }
	 else
	 {
		if (document.getElementById("id").value != "") {
	
			$.ajax({
				url : '<%=request.getContextPath()%>/thesisprogressrecord/updata',
				Type : 'post',
				contentType : "charset=utf-8",
				data : {
					"text" : document.getElementById("showEdit").value,
					"id" : document.getElementById("id").value,
				},
				success : function(r) {
					$.messager.alert('提示', '修改成功','info', function() {
						javascript: window.location.reload();
					});
				},
			});
		} else {
			$.ajax({
				url : '<%=request.getContextPath()%>/thesisprogressrecord/save',
				Type : 'post',
				data : {
					"text" : document.getElementById("showEdit").value,
				},
				success : function(r) {
					$.messager.alert('提示', '添加成功', 'info', function() {
						javascript: window.location.reload();
					});
				},
			});
		}
		}
	/*		}
	 else
	 {
	 $.messager.alert('提示','您的周记长度有误，输入内容请大于100小于300');
	 }*/
}

</script>
</head>

<body>
<!--全局框架 开始 conteiner-->
<div class="container"> 
  <!--标题头图片-->
  <div class="row">
    <div class="body_top"> <img src="${pageContext.request.contextPath}/pages1/img/head.png" align="center" width="1280px"/> </div>
  </div>
  <!--全局12栅格 规划全局区域图线 开始 row+ col-->
  <div class="row">
  <jsp:include page="stu_siderbar.jsp"></jsp:include>
        <!--全局框架结束-->
        <div class="col-xs-9"style="border:2px solid #25465d">
          <div class="row">
            <div class="col-xs-5  xs11" style="margin-bottom:0px; margin-top:5px;"> <strong><font size="3">流程管理》月进展记录提交</font></strong> </div>
            <div class="col-xs-5  xs11" style="margin-bottom:0px; margin-top:5px;" id="right">
              <p ><b><font size="3" id="right">毕业设计流转状态：中期阶段</p>
              </b></font> </div>
          </div>
          <div class="row">
            <div class="col-xs-11  xs11" style="margin-bottom:0px; margin-top:0px;">
              <div class="panel panel-default" style="margin-bottom:0px; margin-top:0px;">
                <div class="panel-heading" align="left"> <a data-toggle="collapse" data-parent="#accordion"  href="#collapseHelp" class="glyphicon glyphicon-chevron-down"> 操作指南 </a> </div>
                <div id="collapseHelp" class="panel-collapse collapse">
                  <div class="panel-body">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;论文进展记录是学生每月需向老师提交两份论文进展记录：
                    <ul>
                      <li> 学生开题报告经过审核通过后，才可以提交论文进展记录。 </li>
                      <li> 教师需要浏览论文进展记录，并给出审核通过操作或审核不通过操作，不通过需要给出修改理由。 </li>
                      <li> 如果学生的进展记录获得教师给出的不通过的评审，需要与指导教师沟通进行修改进展记录，直到通过为止。 </li>
                      <li> 教师的评审论文进展记录的时间和记录，作文教师指导学生论文撰写的依据。 </li>
                    </ul>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <div class="row">
            <div class="col-xs-12">
              <div class="media" align="center">
                <div class="media-body">
                </div>
              </div>
            </div>
          </div>
          <div class="row">
            <div class="col-xs-12" style="margin-top:0px; margin-bottom:0px;">
              <form name="">
                <p style="margin-top:0px; margin-bottom:0px;"><b><font size="3">论文进展记录列表：</p>
                </b></font><br>
                <a data-toggle="collapse" data-parent="#accordion" href="#collapseLWJZ">
                <button type="button" class="btn btn-info btn-bg"  onclick="editContent('add')">添加</button></a>
				<!--周记表格-->
				
				<table id="weektable"></table>
				<!--周记表格结束-->
				
              </form>
            </div>
          </div>
          

          
          
          <div class="row">
            <div class="col-xs-11  xs11">
              <div class="panel panel-default" id="LWJZ" style="display:none;">
               <div class="panel-heading" align="left" style="color:#4682B4;">添加/修改论文进展记录： <a data-toggle="collapse" data-parent="#accordion" href="#collapseLWJZ"><img src="${pageContext.request.contextPath}/pages1/img/close.png" id="X" onClick="hide('LWJZ');"></img></a></div>
                <div id="collapseLWJZ" class="panel-collapse collapse">
                  <div class="panel-body" align="center">
                  <div class="col-xs-12">
					<form id="edit" method="post">
						<input type="hidden" name="id" id="id" value="" />
                    		<textarea class="form-control" rows="3"  id="showEdit" name="showEdit"></textarea>
                       <p align="center" style="margin-bottom:0px; margin-top:5px;" >
                       <button type="button" class="btn btn-success btn-sm"
						onclick="input_check()" value="" />
					提交
					</button></p>
                    </form>
                  </div>
                </div>
              </div>
            </div>
          </div>
          
  <div class="row">
            <div class="col-xs-11  xs11">
              <div class="panel panel-default" id="JSSH" style="display:none;">
                <div class="panel-heading" align="left" style="color:#4682B4;">查看论文进展记录 <a data-toggle="collapse" data-parent="#accordion" href="#collapseBTG"><img src="${pageContext.request.contextPath}/pages1/img/close.png" id="X" onClick="hide('JSSH');"></img></a></div>
                <div id="collapseBTG" class="panel-collapse collapse">
                  <div class="panel-body" align="center">
                    <textarea class="form-control" rows="3" readonly="readonly" id="teaGui"></textarea>
                  </div>
                </div>
              </div>
            </div>
          </div>
          </div>
      </div>
   
      <!--修改结束--> 
      
      <!--全局12栅格 规划全局区域图线 结束 row+ col--> 
    </div>
  </div>
  </div>
  <div class="row" style="background-color:#25465d">
    <p  align="center" style="color:white;background-color:#25465d"><strong>用户单位：</strong>吉林大学珠海学院&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>版权所有：</strong>吉林大学珠海学院计算机科学与技术系</p>
  </div>
  <!--全局框架开始 conteiner--> 
</body>
</html>
